package cn.tedu.carhome.controller;

import cn.tedu.carhome.mapper.StockMapper;
import cn.tedu.carhome.pojo.VO.SupplierVO;
import cn.tedu.carhome.pojo.dto.InsertStockHeadDTO;
import cn.tedu.carhome.pojo.dto.SupplierInsertDTO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.jdbc.Sql;

@SpringBootTest
public class SupplierSelect {
    @Autowired
    SupplierInsertController supplier;
    @Autowired
    StockMapper mapper;
    @Test
    @Sql("classpath:truncate.sql")
    void insert(){
        InsertStockHeadDTO dto = new InsertStockHeadDTO();
        dto.setId(1L);
        dto.setDate("2000");
        dto.setSupplierName("jasgdu");
        dto.setAuditDate("suhidiua");
        dto.setPerson("hasgdhh");
        dto.setVerifier("2132");
        mapper.insertStockHead(dto);
    }

    @Test
    void SupplierInsert(){
        SupplierInsertDTO supplier1 = new SupplierInsertDTO();
        supplier1.setSupplierPhone("4444444");
        supplier1.setContact("11111111");
        supplier.SupplierInsert(supplier1);
    }

}
